package com.zero.manage.web.components.entity;

import com.zero.manage.web.components.base.BaseDataEntity;
import io.gitee.zerowsh.constant.RegConstant;
import io.gitee.zerowsh.validation.group.Insert;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @author zero
 */
@Entity
@Table(name = "sys_dict")
@Getter
@Setter
@ApiModel("系统字典")
public class SysDictEntity extends BaseDataEntity {
    @Column(name = "code")
    @ApiModelProperty("编码")
    @NotBlank(message = "编码必填")
    @Length(max = 20, message = "编码不能大于20个字符", groups = {Insert.class})
    @Pattern(regexp = RegConstant.NOT_CH_REG, message = "编码" + RegConstant.NOT_CH_MSG, groups = {Insert.class})
    private String code;
}
